package com.xoa.controller.party;


import com.xoa.model.party.EsPropertyCompany;
import com.xoa.service.party.EsPropertyCompanyService;
import com.xoa.util.ToJson;
import com.xoa.util.common.newwrapper.BaseWrapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 物业公司
 * Created by gsb on 2018/1/11.
 */
@Controller
@RequestMapping("/esPropertyCompany")
public class EsPropertyCompanyController {

    @Resource
    private EsPropertyCompanyService esPropertyCompanyService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午16:12:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EsPropertyCompany> insertSelective(EsPropertyCompany esPropertyCompany, HttpServletRequest request, String gridLocation){
        return esPropertyCompanyService.insertSelective(esPropertyCompany, request,gridLocation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午16:12:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EsPropertyCompany> deleteByPrimaryKey(Integer pid){
        return esPropertyCompanyService.deleteByPrimaryKey(pid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午16:12:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EsPropertyCompany> updateByPrimaryKeySelective(EsPropertyCompany esPropertyCompany, String gridLocation){
        return esPropertyCompanyService.updateByPrimaryKeySelective(esPropertyCompany,gridLocation);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午16:12:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EsPropertyCompany> selectById(Integer pid){
        return esPropertyCompanyService.selectById(pid);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-11 下午16:12:51
     * 类介绍  :   列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EsPropertyCompany> queryList(EsPropertyCompany esPropertyCompany, Integer page, Integer pageSize,
                                               boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return esPropertyCompanyService.queryList(esPropertyCompany, page, pageSize, useFlag, request, response, export);
    }


    @RequestMapping("/outPutFile")
    @ResponseBody
    public BaseWrapper outPutFile(HttpServletRequest request, HttpServletResponse response){
        return esPropertyCompanyService.outPutFile(request,response);
    }
}
